<html>
  <head>
    <title>MyDiff</title>
    <link rel="stylesheet" href="<?php echo $this->baseUrl('styles.css'); ?>" type="text/css"/>
    <script src="<?php echo $this->baseUrl('js/jquery.min.js'); ?>" type="text/javascript"></script>

    <script type="text/javascript">
    function jqCheckAll(rel, checked)
    {
        $("INPUT[rel=" + rel + "][type='checkbox']").attr('checked', checked);
    }
    </script>

  </head>
  <body>

  <p><a href="<?php echo $this->baseUrl(''); ?>">Back to database selection</a></p>

  <form action="" method="post">
    <fieldset class="submit">
      <input type="submit" value="Compare" />
    </fieldset>

    <h1>Compare</h1>
    <fieldset>
      <input type="checkbox" name="options[type][schema]" value="1" checked="checked" />
      <label class="right" for="options[type][schema]">Schema</label>
    </fieldset>
    <fieldset>
      <input type="checkbox" name="options[type][data]" value="1" checked="checked" />
      <label class="right" for="options[type][data]">Data</label>
    </fieldset>

    <h1>Tables</h1>
    <?php foreach($this->comparison->databases AS $dbI => $database): ?>
      <div class="database item">
        <h2>Database: <?php echo $database->name; ?></h2>
        <input type="button" value="All" onclick="jqCheckAll('db<?php echo $dbI; ?>', true);" />
        <input type="button" value="None" onclick="jqCheckAll('db<?php echo $dbI; ?>', false);" />
        <?php foreach($database->getTables() AS $tableI => $table): ?>
          <fieldset>
            <input type="checkbox" name="options[database][<?php echo $dbI; ?>][table][<?php echo $tableI; ?>]" value="1" rel="db<?php echo $dbI; ?>" checked="checked" />
            <label class="right" for="options[database][<?php echo $dbI; ?>][table][<?php echo $tableI; ?>]"><?php echo $table->name; ?></label>
          </fieldset>
        <?php endforeach; ?>
      </div>
    <?php endforeach; ?>

    <div style="clear: left;"></div>

    <fieldset class="submit">
      <input type="submit" value="Compare" />
    </fieldset>
  </form>

	</body>
</html>
